package com.uber.notes.view;

import com.uber.notes.R;
import com.uber.notes.model.data.GoogleData;

import android.os.Bundle;
import android.accounts.Account;
import android.accounts.AccountManager;
import android.accounts.AccountManagerCallback;
import android.accounts.AccountManagerFuture;
import android.accounts.OperationCanceledException;
import android.app.Activity;
import android.util.Log;
import android.view.Menu;

import java.io.IOException;


import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Date;

import android.app.Activity;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.preference.PreferenceManager;
import android.view.View;
import android.widget.Button;
import android.widget.TextView;


public class MainActivity extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        GoogleData testData = new GoogleData(this);
        Log.v("FAP","accounts len: ");
        /*
        googleAccountManager.manager.getAuthToken(account, AUTH_TOKEN_TYPE, null,
        		  this, new AccountManagerCallback<Bundle>() {
        		    public void run(AccountManagerFuture<Bundle> future) {
        		    try {
        		      // If the user has authorized your application to use the tasks API
        		      // a token is available.
        		      String token = future.getResult().getString(
        		        AccountManager.KEY_AUTHTOKEN);
        		      // Now you can use the Tasks API...
        		      useTasksAPI(token);
        		    } catch (OperationCanceledException e) {
        		      // TODO: The user has denied you access to the API, you
        		      // should handle that
        		    } catch (Exception e) {
        		      handleException(e);
        		    }
        		  }

					//public void run(AccountManagerFuture<Bundle> arg0) {
						// TODO Auto-generated method stub
						
					//}
        		}, null);
        		*/
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }
}
